import {
  IConstant_Enum_Type_AuthClientWeb_LoginType,
  Constant_Enum_Enum_AuthClientWeb_LoginType,
} from '@/common/constants/enum';
import { Decorator_DtoIsNumber_Base } from '@/common/decorators/dtoIsNumber';
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';

export class AuthClientWeb_SignIn_Dto {
  @IsString()
  @IsOptional()
  @ApiProperty({ description: '密码' })
  password?: string;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  @ApiProperty({ type: 'bigint', description: '手机号' })
  phone?: number;

  @IsString()
  @IsOptional()
  @ApiProperty({ description: '邮箱' })
  email?: string;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  @ApiProperty({ description: '验证码' })
  code?: number;

  @IsString()
  @IsOptional()
  @ApiProperty({ description: '邀请码' })
  distributionCode?: string;

  @IsString()
  @IsNotEmpty()
  @ApiProperty({
    description: '登录类型',
    enum: Constant_Enum_Enum_AuthClientWeb_LoginType,
  })
  loginType: IConstant_Enum_Type_AuthClientWeb_LoginType;
}

export class AuthClientWeb_WxChatLogin_Dto {
  @IsString()
  @ApiProperty({ description: '重定向地址' })
  @IsOptional()
  redirectUri?: string;
}
